﻿	<div class = "col-sm-9">
		<h3>下载文件&nbsp;&nbsp;&nbsp;<small>(共享的公共文件)</small></h3>
		<hr>
		<form class="form-inline" >
			<div class="form-group">
				<label for="exampleInputName2">下载码:</label>
				&nbsp;&nbsp;&nbsp;
				<input type="text" class="form-control" id="exampleInputName2" placeholder="Download Code">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</div>
			<button type="submit" class="btn btn-default">搜索</button>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<div class="form-group">
				<label for="exampleInputEmail2">类型:</label>
				&nbsp;&nbsp;&nbsp;
				<select id = "selfileType" name = "filetype" style = "width:80px;height:30px;">
					<option value = "0">文本文件</option>
					<option value = "1">图片文件</option>
					<option value = "2">音乐文件</option>
					<option value = "3">视频文件</option>
					<option value = "4">光盘文件</option>
				</select>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</div>
			<button type="submit" class="btn btn-default">搜索</button>
		</form>
		<hr>
		<h3>上传文件&nbsp;&nbsp;&nbsp;<small>(上传限制大小:500M)</small></h3>
		<hr>
		<div class = "text-danger"><?php echo $error; ?></div>
		<form class = "form-inline" method = "post" enctype = "multipart/form-data" action = "<?php echo site_url('upload/do_upload');?>">
			<div class="form-group">
				<label for="exampleInputFile">选择文件：</label>
				<input type="file" id="exampleInputFile" name = "userfile">
				<p class="help-block">请选择上传的文件</p>
			</div>
			<div class="form-group">
				<label for="upfileStyle">文件分类：</label>
				<select id="upfileStyle" name = "filetype" style = "width:80px;height:30px;">
					<option value = "0">文本文件</option>
					<option value = "1">图片文件</option>
					<option value = "2">音乐文件</option>
					<option value = "3">视频文件</option>
					<option value = "4">光盘文件</option>
				</select>
			</div>
			&nbsp;&nbsp;&nbsp;
			<div class="form-group">
				<label for="upfileRight">文件权限：</label>
				<select id="upfileRight" name = "fileright" style = "width:80px;height:30px">
					<option value = "0">私密文件</option>
					<option value = "1">共享文件</option>
				</select>
			</div>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<button class = "btn btn-default" type = "submit">上传</button>
		</form>
		<hr>
		<h3>管理文件&nbsp;&nbsp;&nbsp;<small>(您的个人空间情况)</small></h3>
		<hr>
		<table class="table">
			<tr>
				<th>编号</th>
				<th>文件名</th>
				<th>文件类型</th>
				<th>上传时间</th>
				<th>访问权限</th>
				<th>设置选项</th>
			</tr>
			<?php
				foreach($res as $row){
				echo "<tr>";
				echo "<td>".$number++."</td>";
				echo "<td>".$row['filename']."</td>";
				echo "<td>";
				switch($row['filetype']){
					case 0:echo "文本文件";break;
					case 1:echo "图片文件";break;
					case 2:echo "音乐文件";break;
					case 3:echo "视频文件";break;
					case 4:echo "光盘文件";break;
				}
				echo "</td>";
				echo "<td>".date('Y-m-d H:i:s',$row['uptime'])."</td>";
				echo "<td>";
				if($row['ispublic']){
					echo "共享";
				}else{
					echo "私密";
				}
				echo "</td>";
				$url = "upload/dropitems/".$row['filename']."/".$row['upauthor'];
				echo "<td><a href = '".site_url($url)."'>删除</a>"; 
				echo "| <a href = '#'>修改</a>"; 
				echo "| <a href = '#'>下载</a></td>";
				echo "</tr>";
			}
			?>
		</table>
		<nav class = "col-sm-offset-2">
		    <span class = "text-info">总计：<?php echo $items;?> 条记录 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总共：<?php echo $pages;?>页</span>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $links;?>
		</nav>
		<hr>
	</div>